@extends('welcome')
<link rel="stylesheet" href="/Home/User/css/safe/ms-style.min.css" />
<link rel="stylesheet" href="/Home/User/css/safe/personal_member.min.css" />
<link rel="stylesheet" href="/Home/User/css/safe/Snaddress.min.css" />
<link rel="stylesheet" href="/Home/login/css/landreg.css" />
<!--导入地区联动插件-->
<script type="text/javascript" src="/Home/UserEdit/jquery.js"></script>
<script type="text/javascript" src="/Home/UserEdit/area.js"></script>
<script type="text/javascript" src="/Home/UserEdit/location.js"></script>
@section('titletitle','个人资料--优品惠')
@section('zhong_content')
  <br/>
  <!-- 用户中心开始 -->
  <div id="ms-center" class="personal-member">
    <div class="cont">
      <div class="cont-side">
        <div class="side-neck">
          <i></i>
        </div>
        <div class="ms-side">
          <article class="side-menu side-menu-off">
            <dl class="side-menu-tree">
              <dt>订单管理</dt>
              <dd><a href="{{url('/home/order/xiangqing')}}" target="_self"><span class="active"></span>订单中心</a></dd>
            </dl>
            <dl class="side-menu-tree">
              <dt>账户管理</dt>
              <dd><a href="{{url('home/user/edit')}}" target="_self" style="color:#f70"><span class="active"></span>我的资料</a></dd>
              <dd><a href="{{url('home/user/password')}}" target="_self"><span class="active"></span>密码修改</a></dd>
              <dd><a href="{{url('home/user/address')}}" target="_self"><span></span>地址管理</a></dd>
            </dl>
            <dl class="side-menu-tree">
              <dt>收藏管理</dt>
              <dd><a href="{{url('home/collect/index')}}" target="_self"><span class="active"></span>收藏列表</a></dd>
            </dl>
            <a ison="on" class="switch-side-menu icon-up-side"><i></i></a>
          </article>
        </div>
      </div>
      <div class="cont-main">
        <div class="main-wrap mt15">
          @if(session('error'))
            {{session('error')}}
          @endif

          @if (count($errors) > 0)
            <div class="">
              <ul>
                @foreach ($errors->all() as $error)
                  <div class="cont-main alert alert-danger alert-dismissable" style="width:400px">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                    <li>{{ $error }}</li>
                  </div>
                @endforeach
              </ul>
            </div>
          @endif

          @if(session('success'))
          <div class="cont-main alert alert-success alert-dismissable" style="width:400px">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
              <h5> {{session('success')}} </h5>
          </div>
          @endif
          @if(session('error'))
          <div class="cont-main alert alert-danger alert-dismissable" style="width:400px">
             <h5> {{session('error')}} </h5>
          </div>
          @endif
          <!-- 个人资料部分 start -->
          <h3>
            <strong>个人资料</strong>
          </h3>
          <div class="form-list tab-switch personal-wrap-show">
            <form action="{{url('/home/user/update')}}" method="post" enctype="multipart/form-data">
              <div class="control-group clearfix">
                <div class="user-profile clearfix">
                  <div class="user-profile-wrap">
                    <div class="controls">
                      <label>当前头像：</label>
                    </div>
                    <div class="profile-avatar">
                      <img name="pic" src="/upload/{{$user->pic}}" width="120" height="120">
                    </div>
                  </div>
                </div>
                <div class="control-group clearfix">
                  <label class="control-label">上传头像</label>
                  <input type="file" name="pic">
                </div>
              </div>
              <div class="control-group clearfix">
                <label class="control-label"><em>*&nbsp;</em>用户名：</label>
                <div class="controls">
                  <input class="text" name="username" value="{{$user->username}}" type="text">
                </div>
              </div>
              <div class="control-group clearfix">
                <label class="control-label"><em>*&nbsp;</em>真实姓名：</label>
                <div class="controls">
                  <input class="text" name="truename" value="{{$user->truename}}" type="text">
                </div>
              </div>
              <div class="control-group clearfix">
                <label class="control-label"><em>*&nbsp;</em>性别：</label>
                <div id="gender" class="controls">
                  <label class="sex-label">
                    <input name="sex" type="radio" value="1" @if($user->sex == 1) checked="checked" @endif>
                    <span>男</span>
                  </label>
                  <label class="sex-label">
                    <input name="sex" type="radio" value="2" @if($user->sex == 2) checked="checked" @endif>
                    <span>女</span>
                  </label>
                  <label class="sex-label">
                    <input name="sex" type="radio" value="3" @if($user->sex == 3) checked="checked" @endif>
                    <span>保密</span>
                  </label>
                </div>
              </div>
              <div class="control-group clearfix">
                <label class="control-label"><em>*&nbsp;</em>手机：</label>
                <div class="controls lh26">
                  <input class="text" name="phone" value="{{$user->phone}}" type="text">
                </div>
              </div>
              <div class="control-group clearfix">
                <label class="control-label"><em>*&nbsp;</em>邮箱：</label>
                <div class="controls lh26">
                  <input class="text" name="email" value="{{$user->email}}" type="text">
                </div>
              </div>
              <div class="control-group clearfix">
                <label class="control-label"><em>*&nbsp;</em>年龄：</label>
                <div class="controls lh26">
                  <input class="text" name="age" value="{{$user->age}}" type="text">
                </div>
              </div>
              <div class="control-group clearfix">
                <label class="control-label"><em>*&nbsp;</em>居住地址：</label>
                <div class="controls lh26">
                  <input class="text" name="address" value="{{$user->address}}" type="text">
                </div>
              </div>
              <div class="control-group clearfix priority-low">
                <label class="control-label">&nbsp;</label>
                <div style="float:left;">
                  <input type="submit" class="ms-stand-btn1" value="保存">
                </div>
                <div id="" class="error-place"></div>
                <div class="error-place mt29"></div>
              </div>
              <input type="hidden" name="id" value="{{$user->id}}">
              <input type="hidden" name="pic" value="{{$user->pic}}">
              {{csrf_field()}}
            </form>
          </div>
          <!-- 个人资料部分 end -->
        </div>
      </div>
    </div>
  </div>
  <!-- 用户中心结束 -->
@endsection